const TestMode = false;

const baseURL = TestMode ? 'https://virtserver.swaggerhub.com/J5539/jsk-mini3/1.0.0/api' :
    'https://service.jsktesting.com/api';

// 写API时需要注意：method需要大写（可以查阅uniapp的文档，request中需要大写）
export const USER_API = {
    login: {
        url: baseURL + '/login',
        method: 'POST'
    },
    user: {
        url: baseURL + '/user',
        method: 'GET'
    },
    putUser: {
        url: baseURL + '/user',
        method: 'PUT'
    },
    users: {
        url: baseURL + '/users',
        method: 'GET'
    },
    bind: {
        url: baseURL + '/user/bind',
        method: 'POST'
    },
    switchUser: {
        url: baseURL + '/user/switch',
        method: 'PUT'
    },
    userAddress: {
        url: baseURL + '/user-address',
        method: 'GET'
    },
    putUserAddress: {
        url: baseURL + '/user-address',
        method: 'PUT'
    },
};
export const COURSE_API = {
    course: {
        // 查询一门课程的信息
        url: baseURL + '/course',
        method: 'GET'
    },
    timeTable: {
        // 查询课表信息
        url: baseURL + '/course-timetable',
        method: 'GET'
    },
    transcript: {
        url: baseURL + '/user-course/transcript',
        method: 'GET'
    },
    submissionCode: {
        url: baseURL + '/user-course/lesson-submission-code',
        method: 'GET'
    }
};

export const COURSE_ARRA_API = {
    courseGet: {
        // 查询一节课的信息
        url: baseURL + '/course-arrangement/report',
        method: 'GET'
    },
    coursePost: {
        // 查询一节课的信息
        url: baseURL + '/course-arrangement/report',
        method: 'POST'
    }
};


const tutorBaseURL = baseURL + '/tutor';
export const TUTOR_API = {
    createQu: {
        // 创建问题
        url: tutorBaseURL + '/question',
        method: 'POST'
    },
    modifyQu: {
        url: tutorBaseURL + '/question',
        method: 'PUT'
    },
    quList: {
        // 获取问题列表
        url: tutorBaseURL + '/questions',
        method: 'GET'
    },
    discussions: {
        // 获取回复列表
        url: tutorBaseURL + '/discussions',
        method: 'GET'
    },
    createDiscussion: {
        // 创建回复
        url: tutorBaseURL + '/discussion',
        method: 'POST'
    }
};

export const ORDER_API = {
    orderList: {
        // 获取订单列表
        url: baseURL + '/orders',
        method: 'GET'
    },
    invoice: {
        url: baseURL + '/invoice',
        method: 'POST'
    }
};

export const PHOTO_URL = {
    camera: {
        url: baseURL + '/user-course/current-photo',
        method: 'GET'
    },
    screen: {
        url: baseURL + '/user-course/current-screenshot',
        method: 'GET'
    }
};

export const NOTIF_API = {
    notifList: {
        // 获取通知列表
        url: baseURL + '/notifications',
        method: 'GET'
    },
    notifDetail: {
        // 获取通知详情
        url: baseURL + '/notification',
        method: 'GET'
    }
};

export const COMMON_API = {
    uploadPic: {
        url: baseURL + '/file/upload',
        method: 'POST'
    },
    provinces: {
        url: baseURL + '/provinces',
        method: 'GET'
    }
};

export const LOGISTICS_API = {
    url: 'https://poll.kuaidi100.com/poll/query.do',
    method: 'POST',
    content_type: 'application/x-www-form-urlencoded',
    customer: '285644A60907A27DF56CE8579C62BDA2',
    key: 'ZBFmacEg116'
};

export const UPLOAD_API = {
    url: baseURL + '/file/upload',
    method: 'POST',
};
